#pragma once

#include "MemoryDefined.h"
#include "GlobalArrayList.h"
#include "FrameBuffer.h"

static void* g_ptr_gminstance_singlton = NULL;
class DLL_PUBLIC_GMINSTANCE CGlobalMemoryInstance
{
public:
	CGlobalMemoryInstance(void);
	~CGlobalMemoryInstance(void);

	static CGlobalMemoryInstance* GetInstance()
	{
		if(g_ptr_gminstance_singlton == NULL)
			g_ptr_gminstance_singlton = new CGlobalMemoryInstance();

		return (CGlobalMemoryInstance*)g_ptr_gminstance_singlton;
	}

public:
	CFrameBuffer* m_ptr_lstFrameBuffers; // FrameBuffer array list

private:
	int	m_int_size;

public:
	CFrameBuffer* AllocateFrameBuffer(int int_stream_id);
	CFrameBuffer* AttachFrameBuffer(int int_stream_id);
	CFrameBuffer* AttachFrameBufferByIndex(int int_index);
	void DetachFrameBuffer(CFrameBuffer* ptr_obj_buffer);
	void FreeFrameBuffer(CFrameBuffer* ptr_obj_buffer);
	int GetSize() {return m_int_size;}
};
